﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using GrainManage.Data.Model.Table;
using GrainManage.Data.Model;

namespace GrainManage.Data.Service
{
    public class ColumnService : BaseService
    {
        public ColumnService(GrainManage.Data.Access.AccessBase proc) : base(proc) { }

        public List<ColumnTable> GetAll(IPageable page, ICountable records)
        {
            var table = Proc.ExecuteQuery(ProcConst.Column_GetAllByExtent, page.PageIndex, page.PageSize);
            return ConvertToModel<ColumnTable>(table, records);
        }

        public string GetHeader(string columnName)
        {
            //Column_GetHeaderByColumn
            return Proc.ExecuteScalar(ProcConst.Column_GetHeaderByColumn, columnName) as string;
        }
    }
}
